﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Internet_Cafe
{
    /// <summary>
    /// Interaction logic for Bill.xaml
    /// </summary>
    public partial class Bill : Window
    {
        App_Code.DatabaseModel.Bill b;
        public Bill(App_Code.DatabaseModel.Bill _b)
        {
            InitializeComponent();

            b = _b;

            txtSuma.Text = String.Format("{0:0.00}",b.Cost) + " ден.";
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (checkNaplati.IsChecked == true)
            {
                b.isPayed = true;
                App_Code.DataBaseAccess.DbAccountingAccess.Insert(b);
                Close();
            }
            else
            {
                b.isPayed = false;
                App_Code.DataBaseAccess.DbAccountingAccess.Insert(b);
                Close();
            }
            
        }
    }
}
